<?php
if(!empty($_GET['id'])){
include('fungsi_depan.php');
$cat = kategori();
$data = kategori_tampil($_GET['id']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>budinews.com</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="css/global.css" rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
</head>
<body>
<!-- BEGIN HEADER -->
<center>
  <div class="header"><h1 class="judul-atas"><a href="#">budinews.com</a></h1>
  <p>portal berita terlengkap</p>
  </div>
 </center>
<!-- END HEADER -->
<!-- BEGIN NAV -->
<div id="nav">
  <ul>
	<li><a href="../pwl">Home</a></li>
    <?php
		foreach ($cat as $kategori){
			echo "<li><a href='kategori.php?id=".$kategori."'>".$kategori."</a></li>";
		}
		?>
  </ul>
</div>
<!-- END NAV -->
<br/><br/>
<!-- BEGIN CONTENT WRAPPER -->
<div id="content-wrapper">
  <!-- BEGIN MAIN -->
  <div id="main">
    <div id="headlines">
      <div id="main-headline">
        <h2 class="heading-blue-cat" style="color: white;">Berita Dalam Kategori <?php echo $data['kategori'];?></h2>
		<?php kategori_show($data['id_kategori']);?>
		<h2 class="heading">Info Seleb</h2>        
        <?php info_seleb();?>
      </div>
      <div id="more-headlines">
        <h2 class="heading">Berita Terkini</h2>
        <?php feature();?>
		<h2 class="heading">Fashion</h2>
		<center>
        <?php fashion();?>
		</center>
      </div>
    </div>
  </div>
  <!-- END MAIN -->
  <!-- BEGIN SIDEBARS -->
  <div id="sidebars">
	<h2 class="heading-blue">Cari Berita</h2>
	<form action="cari.php" method="get">
		<input type="text" name="cari" style="width: 233px;"/><input type="submit" value="cari"/>
	</form>
	<br/>
	<h2 class="heading-blue">Olahraga</h2>
    <?php olahraga();?>
	<h2 class="heading-blue">Berita Dunia</h2>
    <?php dunia();?>
	<h2 class="heading-blue">Politik</h2>
	<?php politik();?>
	<h2 class="heading-blue">Kesehatan</h2>
    <?php kesehatan();?>
	<h2 class="heading-blue">Tekno</h2>
    <?php tekno();?>
  </div>
  <!-- END SIDEBARS -->
</div>
<!-- END CONTENT WRAPPER-->
<!-- BEGIN EXTRAS -->
<div id="extras">
  <div id="recommended">
    <h2 class="heading">Berita Terpopuler</h2>
    <ul>
	<?php $banyak = terbanyak();
		#print_r($banyak);exit;
		while($ter = mysql_fetch_assoc($banyak)){
		echo '<li><a href="detail.php?id='.$ter['id_berita'].'">'.$ter['judul'].' &raquo;</a></li>';
		}
	?>
    </ul>
  </div>
  <div id="programs">
    <h2 class="heading">Unik</h2>
    <ul>
	<?php $banyak = terunik();
		#print_r($banyak);exit;
		while($ter = mysql_fetch_assoc($banyak)){
		echo '<li><a href="detail.php?id='.$ter['id_berita'].'">'.$ter['judul'].' &raquo;</a></li>';
		}
	?>
    </ul>
</div>
  <div id="cartoon">
    <h2 class="heading">Film</h2>
    <ul>
	<?php $banyak = film();
		#print_r($banyak);exit;
		while($ter = mysql_fetch_assoc($banyak)){
		echo '<li><a href="detail.php?id='.$ter['id_berita'].'">'.$ter['judul'].' &raquo;</a></li>';
		}
	?>
    </ul>
</div>
<!-- END EXTRAS -->
<!-- BEGIN FOOTER -->
<div id="footer">
  <ul>
    <li>&copy;<?php echo date('Y');?> | <a href="#">budinews.com</a></li>
  </ul>
</div>
<!-- END FOOTER -->
</html>
<?php }else{
	echo "<script>
			window.location = '../pwl';
	</script>";
}

?>